package com.ruoyi.foodworks.mapper;

import com.ruoyi.foodworks.domain.CommentReply;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 评论回复Mapper接口
 * 
 * @author ruoyi
 * @date 2024-01-01
 */
public interface CommentReplyMapper {
    
    /**
     * 获取评论回复列表（包含用户信息）
     */
    List<CommentReply> selectRepliesWithUserInfo(@Param("commentId") Long commentId);
    
    /**
     * 获取回复数量
     */
    Integer selectReplyCountByCommentId(@Param("commentId") Long commentId);
    
    /**
     * 获取回复点赞数量
     */
    Integer selectReplyLikeCount(@Param("replyId") Long replyId);
    
    /**
     * 根据ID查询回复
     */
    CommentReply selectCommentReplyById(Long id);
    
    /**
     * 新增回复
     */
    int insertCommentReply(CommentReply reply);
    
    /**
     * 删除回复
     */
    int deleteCommentReplyById(Long id);
}
